package net.lab1024.sa.admin.module.business.wms.stock.dao;

import java.util.List;
import net.lab1024.sa.admin.module.business.wms.stock.domain.entity.StockEntity;
import net.lab1024.sa.admin.module.business.wms.stock.domain.form.StockQueryForm;
import net.lab1024.sa.admin.module.business.wms.stock.domain.vo.StockVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 库存信息表（单租户版） Dao
 *
 * @Author ADog
 * @Date 2025-09-20 15:55:03
 * @Copyright 1.0
 */

@Mapper
public interface StockDao extends BaseMapper<StockEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<StockVO> queryPage(Page page, @Param("queryForm") StockQueryForm queryForm);

    /**
     * 根据物料ID和删除状态查询库存记录
     */
    List<StockVO> findByMaterialIdAndIsDeleted(
            @Param("materialId") Long materialId,
            @Param("isDeleted") Boolean isDeleted);
}
